/*
 * 案由变动
 */
var aybdTable = function(){
	$('#aybdRecordId').datagrid({
		width: '100%',
		height: '100%',
		fitColumns: true,
		singleSelect:true,
		url:'',
		method:'post',
		//对应json数据中的每一列
		columns : [ [
			{field : '', width : 50,checkbox:'true',},
			{field : 'ay',width : 150,title:'案由',sortable:'true',formatter: function(value,row,index){return '<span title='+(row.ay==null?"":row.ay)+'>'+(row.ay==null?"":row.ay)+'</span>'}},
			{field : 'czr',title : '操作人',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.czr==null?"":row.czr)+'>'+(row.czr==null?"":row.czr)+'</span>'}}, 
			{field : 'czsj',title : '操作时间',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.czsj==null?"":row.czsj)+'>'+(row.czsj==null?"":row.czsj)+'</span>'}},
			] ],
			idField:'id',
			loadMsg:'加载中, 请  稍  等  …',
//			pagination:true,
			sortName:'blrqString',
			sortOrder:'desc',
			onDblClickRow: function(){
				saveHjbl();
			},
			onLoadSuccess: function(data){//加载完毕后获取所有的checkbox遍历
				$('#aybdRecordId').datagrid("selectRow", 0);
			},
			queryParams:{  
				"pageSize" : function(){  
					return $('#aybdRecordId').datagrid("getPager").pagination("options").pageSize;  
				},  
				"pageIndex" : function(){  
					return $('#aybdRecordId').datagrid("getPager").pagination("options").pageNumber;  
				}

			},
			pageSize:10,
			view: detailview,
			detailFormatter:function(index,rowData){
				if(rowData.bz==null){
					rowData.bz=" ";
				}
				return '<table><tr><td>备注:'+rowData.bz+'</td></tr></table>'
			},
	});
};

/*
 * 历史环节
 */
var lishjTable = function(){
	$('#lishjRecordlId').datagrid({
		width: '100%',
		height: '100%',
		fitColumns: true,
		singleSelect:true,
		url:'',
		method:'post',
		//对应json数据中的每一列
		columns : [ [
			{field : '', width : 50,checkbox:'true',},
			{field : 'bajd',width : 150,title:'办案阶段',sortable:'true',formatter: function(value,row,index){return '<span title='+(row.bajd==null?"":row.bajd)+'>'+(row.bajd==null?"":row.bajd)+'</span>'}},
			{field : 'bdrq',title : '变动日期',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.bdrq==null?"":row.bdrq)+'>'+(row.bdrq==null?"":row.bdrq)+'</span>'}}, 
			{field : 'gyqx',title : '关押期限',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.gyqx==null?"":row.gyqx)+'>'+(row.gyqx==null?"":row.gyqx)+'</span>'}},
			{field : 'dwlx',title : '单位类型',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.dwlx==null?"":row.v)+'>'+(row.dwlx==null?"":row.dwlx)+'</span>'}},
			{field : 'badw',title : '办案单位',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.badw==null?"":row.badw)+'>'+(row.badw==null?"":row.badw)+'</span>'}},
			{field : 'bar',title : '办案人',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.bar==null?"":row.bar)+'>'+(row.bar==null?"":row.v)+'</span>'}},
			{field : 'wsh',title : '文书号',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.wsh==null?"":row.wsh)+'>'+(row.wsh==null?"":row.wsh)+'</span>'}},
			] ],
			idField:'id',
			loadMsg:'加载中, 请  稍  等  …',
//			pagination:true,
			sortName:'blrqString',
			sortOrder:'desc',
			onDblClickRow: function(){
				saveHjbl();
			},
			onLoadSuccess: function(data){//加载完毕后获取所有的checkbox遍历
				$('#lishjRecordlId').datagrid("selectRow", 0);
			},
			queryParams:{  
				"pageSize" : function(){  
					return $('#lishjRecordlId').datagrid("getPager").pagination("options").pageSize;  
				},  
				"pageIndex" : function(){  
					return $('#lishjRecordlId').datagrid("getPager").pagination("options").pageNumber;  
				}

			},
			pageSize:10,
			view: detailview,
			detailFormatter:function(index,rowData){
				if(rowData.bz==null){
					rowData.bz=" ";
				}
				return '<table><tr><td>备注:'+rowData.bz+'</td></tr></table>'
			},
	});
};

/*
 * 刑期变动
 */
var xqbdTable = function(){
	$('#xqbdRecordId').datagrid({
		width: '100%',
		height: '100%',
		fitColumns: true,
		singleSelect:true,
		url:'',
		method:'post',
		//对应json数据中的每一列
		columns : [ [
			{field : '', width : 50,checkbox:'true',},
			{field : 'blrq',width : 150,title:'办理日期',sortable:'true',formatter: function(value,row,index){return '<span title='+(row.blrq==null?"":row.blrq)+'>'+(row.blrq==null?"":row.blrq)+'</span>'}},
			{field : 'yxmrq',title : '原刑满日期',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.yxmrq==null?"":row.yxmrq)+'>'+(row.yxmrq==null?"":row.yxmrq)+'</span>'}}, 
			{field : 'jjxq',title : '加减刑期',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.jjxq==null?"":row.jjxq)+'>'+(row.jjxq==null?"":row.jjxq)+'</span>'}},
			{field : 'xmsfrq',title : '刑满释放日期',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.xmsfrq==null?"":row.xmsfrq)+'>'+(row.xmsfrq==null?"":row.xmsfrq)+'</span>'}},
			{field : 'pzr',title : '批准人',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.pzr==null?"":row.pzr)+'>'+(row.pzr==null?"":row.pzr)+'</span>'}},
			{field : 'pzwh',title : '批准文号',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.pzwh==null?"":row.pzwh)+'>'+(row.pzwh==null?"":row.pzwh)+'</span>'}},
			] ],
			idField:'id',
			loadMsg:'加载中, 请  稍  等  …',
//			pagination:true,
			sortName:'blrqString',
			sortOrder:'desc',
			onDblClickRow: function(){
				saveHjbl();
			},
			onLoadSuccess: function(data){//加载完毕后获取所有的checkbox遍历
				$('#xqbdRecordId').datagrid("selectRow", 0);
			},
			queryParams:{  
				"pageSize" : function(){  
					return $('#xqbdRecordId').datagrid("getPager").pagination("options").pageSize;  
				},  
				"pageIndex" : function(){  
					return $('#xqbdRecordId').datagrid("getPager").pagination("options").pageNumber;  
				}

			},
			pageSize:10,
			view: detailview,
			detailFormatter:function(index,rowData){
				if(rowData.bz==null){
					rowData.bz=" ";
				}
				return '<table><tr><td>备注:'+rowData.bz+'</td></tr></table>'
			},
	});
};

/*
 * 延期信息
 */
var yqxxTable = function(){
	$('#yqxxRecordId').datagrid({
		width: '100%',
		height: '100%',
		fitColumns: true,
		singleSelect:true,
		url:'',
		method:'post',
		//对应json数据中的每一列
		columns : [ [
			{field : '', width : 50,checkbox:'true',},
			{field : 'blrq',width : 150,title:'办理日期',sortable:'true',formatter: function(value,row,index){return '<span title='+(row.blrq==null?"":row.blrq)+'>'+(row.blrq==null?"":row.blrq)+'</span>'}},
			{field : 'ygyqx',title : '原关押期限',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.ygyqx==null?"":row.ygyqx)+'>'+(row.ygyqx==null?"":row.ygyqx)+'</span>'}}, 
			{field : 'xgyqx',title : '现关押期限',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.xgyqx==null?"":row.xgyqx)+'>'+(row.v==null?"":row.xgyqx)+'</span>'}},
			{field : 'flwsh',title : '法律文书号',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.flwsh==null?"":row.flwsh)+'>'+(row.flwsh==null?"":row.flwsh)+'</span>'}},
			{field : 'fzr',title : '负责人',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.fzr==null?"":row.fzr)+'>'+(row.fzr==null?"":row.fzr)+'</span>'}},
			{field : 'pzdw',title : '批准单位',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.pzdw==null?"":row.pzdw)+'>'+(row.pzdw==null?"":row.pzdw)+'</span>'}},
			{field : 'bz',title : '备注',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.bz==null?"":row.bz)+'>'+(row.bz==null?"":row.bz)+'</span>'}},
			] ],
			idField:'id',
			loadMsg:'加载中, 请  稍  等  …',
//			pagination:true,
			sortName:'blrqString',
			sortOrder:'desc',
			onDblClickRow: function(){
				saveHjbl();
			},
			onLoadSuccess: function(data){//加载完毕后获取所有的checkbox遍历
				$('#yqxxRecordId').datagrid("selectRow", 0);
			},
			queryParams:{  
				"pageSize" : function(){  
					return $('#yqxxRecordId').datagrid("getPager").pagination("options").pageSize;  
				},  
				"pageIndex" : function(){  
					return $('#yqxxRecordId').datagrid("getPager").pagination("options").pageNumber;  
				}

			},
			pageSize:10,
			view: detailview,
			detailFormatter:function(index,rowData){
				if(rowData.bz==null){
					rowData.bz=" ";
				}
				return '<table><tr><td>备注:'+rowData.bz+'</td></tr></table>'
			},
	});
};
/*
 * 判决登记
 */
var pjdjTables = function(){
	$('#pjdjRecordId').datagrid({
		width: '100%',
		height: '100%',
		fitColumns: true,
		singleSelect:true,
		url:'',
		method:'post',
		//对应json数据中的每一列
		columns : [ [
			{field : '', width : 50,checkbox:'true',},
			{field : 'pjrq',width : 150,title:'判决日期',sortable:'true',formatter: function(value,row,index){return '<span title='+(row.pjrq==null?"":row.pjrq)+'>'+(row.pjrq==null?"":row.pjrq)+'</span>'}},
			{field : 'pjdw',title : '判决单位',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.pjdw==null?"":row.pjdw)+'>'+(row.pjdw==null?"":row.pjdw)+'</span>'}}, 
			{field : 'wsh',title : '文书号',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.wsh==null?"":row.wsh)+'>'+(row.wsh==null?"":row.wsh)+'</span>'}},
			{field : 'cljg',title : '处理结果',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.cljg==null?"":row.cljg)+'>'+(row.cljg==null?"":row.cljg)+'</span>'}},
			{field : 'fjx',title : '附加刑',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.fjx==null?"":row.fjx)+'>'+(row.fjx==null?"":row.fjx)+'</span>'}},
			{field : 'xq',title : '刑期',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.xq==null?"":row.xq)+'>'+(row.xq==null?"":row.xq)+'</span>'}},
			] ],
			idField:'id',
			loadMsg:'加载中, 请  稍  等  …',
//			pagination:true,
			sortName:'blrqString',
			sortOrder:'desc',
			onDblClickRow: function(){
				saveHjbl();
			},
			onLoadSuccess: function(data){//加载完毕后获取所有的checkbox遍历
				$('#pjdjRecordId').datagrid("selectRow", 0);
			},
			queryParams:{  
				"pageSize" : function(){  
					return $('#pjdjRecordId').datagrid("getPager").pagination("options").pageSize;  
				},  
				"pageIndex" : function(){  
					return $('#pjdjRecordId').datagrid("getPager").pagination("options").pageNumber;  
				}

			},
			pageSize:10,
			view: detailview,
			detailFormatter:function(index,rowData){
				if(rowData.bz==null){
					rowData.bz=" ";
				}
				return '<table><tr><td>备注:'+rowData.bz+'</td></tr></table>'
			},
	});
};

/*
 * 提审登记
 */
var tsdjTable = function(){
	$('#tsdjRecordId').datagrid({
		width: '100%',
		height: '100%',
		fitColumns: true,
		singleSelect:true,
		url:'',
		method:'post',
		//对应json数据中的每一列
		columns : [ [
			{field : '', width : 50,checkbox:'true',},
			{field : 'tsdw',width : 150,title:'提审单位',sortable:'true',formatter: function(value,row,index){return '<span title='+(row.tsdw==null?"":row.tsdw)+'>'+(row.tsdw==null?"":row.tsdw)+'</span>'}},
			{field : 'tsry',title : '提审人员',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.tsry==null?"":row.tsry)+'>'+(row.tsry==null?"":row.tsry)+'</span>'}}, 
			{field : 'zjlx',title : '证件类型',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.zjlx==null?"":row.zjlx)+'>'+(row.zjlx==null?"":row.zjlx)+'</span>'}},
			{field : 'zjh',title : '证件号',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.zjh==null?"":row.zjh)+'>'+(row.zjh==null?"":row.zjh)+'</span>'}},
			{field : 'kssj',title : '开始时间',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.kssj==null?"":row.kssj)+'>'+(row.kssj==null?"":row.kssj)+'</span>'}},
			{field : 'jssj',title : '结束时间',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.jssj==null?"":row.jssj)+'>'+(row.jssj==null?"":row.jssj)+'</span>'}},
			{field : 'sjmj',title : '收监民警',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.sjmj==null?"":row.sjmj)+'>'+(row.sjmj==null?"":row.sjmj)+'</span>'}},
			] ],
			idField:'id',
			loadMsg:'加载中, 请  稍  等  …',
//			pagination:true,
			sortName:'blrqString',
			sortOrder:'desc',
			onDblClickRow: function(){
				saveHjbl();
			},
			onLoadSuccess: function(data){//加载完毕后获取所有的checkbox遍历
				$('#tsdjRecordId').datagrid("selectRow", 0);
			},
			queryParams:{  
				"pageSize" : function(){  
					return $('#tsdjRecordId').datagrid("getPager").pagination("options").pageSize;  
				},  
				"pageIndex" : function(){  
					return $('#tsdjRecordId').datagrid("getPager").pagination("options").pageNumber;  
				}

			},
			pageSize:10,
			view: detailview,
			detailFormatter:function(index,rowData){
				if(rowData.bz==null){
					rowData.bz=" ";
				}
				return '<table><tr><td>备注:'+rowData.bz+'</td></tr></table>'
			},
	});
};

/*
 * 律师会见
 */
var lvshjTable = function(){
	$('#lvshjRecordId').datagrid({
		width: '100%',
		height: '100%',
		fitColumns: true,
		singleSelect:true,
		url:'',
		method:'post',
		//对应json数据中的每一列
		columns : [ [
			{field : '', width : 50,checkbox:'true',},
			{field : 'lsxm',width : 150,title:'律师姓名',sortable:'true',formatter: function(value,row,index){return '<span title='+(row.lsxm==null?"":row.lsxm)+'>'+(row.lsxm==null?"":row.lsxm)+'</span>'}},
			{field : 'zjh',title : '证件号',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.v==null?"":row.zjh)+'>'+(row.zjh==null?"":row.zjh)+'</span>'}}, 
			{field : 'lsdw',title : '律师单位',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.lsdw==null?"":row.v)+'>'+(row.lsdw==null?"":row.lsdw)+'</span>'}},
			{field : 'rs',title : '人数',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.rs==null?"":row.rs)+'>'+(row.rs==null?"":row.rs)+'</span>'}},
			{field : 'hjsj',title : '会见时间',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.hjsj==null?"":row.hjsj)+'>'+(row.hjsj==null?"":row.hjsj)+'</span>'}},
			] ],
			idField:'id',
			loadMsg:'加载中, 请  稍  等  …',
//			pagination:true,
			sortName:'blrqString',
			sortOrder:'desc',
			onDblClickRow: function(){
				saveHjbl();
			},
			onLoadSuccess: function(data){//加载完毕后获取所有的checkbox遍历
				$('#lvshjRecordId').datagrid("selectRow", 0);
			},
			queryParams:{  
				"pageSize" : function(){  
					return $('#lvshjRecordId').datagrid("getPager").pagination("options").pageSize;  
				},  
				"pageIndex" : function(){  
					return $('#lvshjRecordId').datagrid("getPager").pagination("options").pageNumber;  
				}

			},
			pageSize:10,
			view: detailview,
			detailFormatter:function(index,rowData){
				if(rowData.bz==null){
					rowData.bz=" ";
				}
				return '<table><tr><td>备注:'+rowData.bz+'</td></tr></table>'
			},
	});
};

/*
 * 同案犯
 */
var tafTable = function(){
	$('#tafRecordId').datagrid({
		width: '100%',
		height: '100%',
		fitColumns: true,
		singleSelect:true,
		url:'',
		method:'post',
		//对应json数据中的每一列
		columns : [ [
			{field : '', width : 50,checkbox:'true',},
			{field : 'rybg',width : 150,title:'人员编号',sortable:'true',formatter: function(value,row,index){return '<span title='+(row.rybg==null?"":row.rybg)+'>'+(row.rybg==null?"":row.rybg)+'</span>'}},
			{field : 'xm',title : '姓名',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.xm==null?"":row.xm)+'>'+(row.xm==null?"":row.xm)+'</span>'}}, 
			{field : 'jsh',title : '监室号',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.jsh==null?"":row.jsh)+'>'+(row.jsh==null?"":row.jsh)+'</span>'}},
			{field : 'tafh',title : '同案犯号',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.tafh==null?"":row.tafh)+'>'+(row.tafh==null?"":row.tafh)+'</span>'}},
			] ],
			idField:'id',
			loadMsg:'加载中, 请  稍  等  …',
//			pagination:true,
			sortName:'blrqString',
			sortOrder:'desc',
			onDblClickRow: function(){
				saveHjbl();
			},
			onLoadSuccess: function(data){//加载完毕后获取所有的checkbox遍历
				$('#tafRecordId').datagrid("selectRow", 0);
			},
			queryParams:{  
				"pageSize" : function(){  
					return $('#tafRecordId').datagrid("getPager").pagination("options").pageSize;  
				},  
				"pageIndex" : function(){  
					return $('#tafRecordId').datagrid("getPager").pagination("options").pageNumber;  
				}

			},
			pageSize:10,
			view: detailview,
			detailFormatter:function(index,rowData){
				if(rowData.bz==null){
					rowData.bz=" ";
				}
				return '<table><tr><td>备注:'+rowData.bz+'</td></tr></table>'
			},
	});
};

/*
 * 就医信息
 */
var jyxxTable = function(){
	$('#jyxxRecordId').datagrid({
		width: '100%',
		height: '100%',
		fitColumns: true,
		singleSelect:true,
		url:'',
		method:'post',
		//对应json数据中的每一列
		columns : [ [
			{field : '', width : 50,checkbox:'true',},
			{field : 'zdrq',width : 150,title:'诊断日期',sortable:'true',formatter: function(value,row,index){return '<span title='+(row.zdrq==null?"":row.zdrq)+'>'+(row.zdrq==null?"":row.zdrq)+'</span>'}},
			{field : 'ys',title : '医生',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.ys==null?"":row.ys)+'>'+(row.ys==null?"":row.ys)+'</span>'}}, 
			{field : 'zs',title : '自述',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.zs==null?"":row.zs)+'>'+(row.zs==null?"":row.zs)+'</span>'}},
			{field : 'yszd',title : '医生诊断',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.yszd==null?"":row.yszd)+'>'+(row.yszd==null?"":row.yszd)+'</span>'}},
			{field : 'cljg',title : '处理结果',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.cljg==null?"":row.cljg)+'>'+(row.cljg==null?"":row.cljg)+'</span>'}},
			{field : 'jylx',title : '就医类型',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.jylx==null?"":row.jylx)+'>'+(row.jylx==null?"":row.jylx)+'</span>'}},
			] ],
			idField:'id',
			loadMsg:'加载中, 请  稍  等  …',
//			pagination:true,
			sortName:'blrqString',
			sortOrder:'desc',
			onDblClickRow: function(){
				saveHjbl();
			},
			onLoadSuccess: function(data){//加载完毕后获取所有的checkbox遍历
				$('#jyxxRecordId').datagrid("selectRow", 0);
			},
			queryParams:{  
				"pageSize" : function(){  
					return $('#jyxxRecordId').datagrid("getPager").pagination("options").pageSize;  
				},  
				"pageIndex" : function(){  
					return $('#jyxxRecordId').datagrid("getPager").pagination("options").pageNumber;  
				}

			},
			pageSize:10,
			view: detailview,
			detailFormatter:function(index,rowData){
				if(rowData.bz==null){
					rowData.bz=" ";
				}
				return '<table><tr><td>备注:'+rowData.bz+'</td></tr></table>'
			},
	});
};

/*
 * 加减分记录
 */
var jjfjlTable = function(){
	$('#jjfjlRecordId').datagrid({
		width: '100%',
		height: '100%',
		fitColumns: true,
		singleSelect:true,
		url:'',
		method:'post',
		//对应json数据中的每一列
		columns : [ [
			{field : '', width : 50,checkbox:'true',},
			{field : 'khsj',width : 150,title:'考核时间',sortable:'true',formatter: function(value,row,index){return '<span title='+(row.khsj==null?"":row.khsj)+'>'+(row.khsj==null?"":row.khsj)+'</span>'}},
			{field : 'jjfs',title : '加减分数',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.jjfs==null?"":row.jjfs)+'>'+(row.jjfs==null?"":row.jjfs)+'</span>'}}, 
			{field : 'khr',title : '考核人',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.khr==null?"":row.khr)+'>'+(row.khr==null?"":row.khr)+'</span>'}},
			{field : 'khmk',title : '考核模块',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.khmk==null?"":row.khmk)+'>'+(row.khmk==null?"":row.khmk)+'</span>'}},
			{field : 'jjfyy',title : '加减分原因',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.jjfyy==null?"":row.jjfyy)+'>'+(row.jjfyy==null?"":row.jjfyy)+'</span>'}},
			] ],
			idField:'id',
			loadMsg:'加载中, 请  稍  等  …',
//			pagination:true,
			sortName:'blrqString',
			sortOrder:'desc',
			onDblClickRow: function(){
				saveHjbl();
			},
			onLoadSuccess: function(data){//加载完毕后获取所有的checkbox遍历
				$('#jjfjlRecordId').datagrid("selectRow", 0);
			},
			queryParams:{  
				"pageSize" : function(){  
					return $('#jjfjlRecordId').datagrid("getPager").pagination("options").pageSize;  
				},  
				"pageIndex" : function(){  
					return $('#jjfjlRecordId').datagrid("getPager").pagination("options").pageNumber;  
				}

			},
			pageSize:10,
			view: detailview,
			detailFormatter:function(index,rowData){
				if(rowData.bz==null){
					rowData.bz=" ";
				}
				return '<table><tr><td>备注:'+rowData.bz+'</td></tr></table>'
			},
	});
};

/*
 * 调监记录
 */
var djjlTable = function(){
	$('#djjlRecordId').datagrid({
		width: '100%',
		height: '100%',
		fitColumns: true,
		singleSelect:true,
		url:'',
		method:'post',
		//对应json数据中的每一列
		columns : [ [
			{field : '', width : 50,checkbox:'true',},
			{field : 'yjsh',width : 150,title:'原监室号',sortable:'true',formatter: function(value,row,index){return '<span title='+(row.yjsh==null?"":row.yjsh)+'>'+(row.yjsh==null?"":row.yjsh)+'</span>'}},
			{field : 'xjsh',title : '现监室号',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.xjsh==null?"":row.xjsh)+'>'+(row.xjsh==null?"":row.xjsh)+'</span>'}}, 
			{field : 'djr',title : '调监人',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.djr==null?"":row.djr)+'>'+(row.djr==null?"":row.djr)+'</span>'}},
			{field : 'tzsj',title : '调整时间',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.tzsj==null?"":row.tzsj)+'>'+(row.tzsj==null?"":row.tzsj)+'</span>'}},
			] ],
			idField:'id',
			loadMsg:'加载中, 请  稍  等  …',
//			pagination:true,
			sortName:'blrqString',
			sortOrder:'desc',
			onDblClickRow: function(){
				saveHjbl();
			},
			onLoadSuccess: function(data){//加载完毕后获取所有的checkbox遍历
				$('#djjlRecordId').datagrid("selectRow", 0);
			},
			queryParams:{  
				"pageSize" : function(){  
					return $('#djjlRecordId').datagrid("getPager").pagination("options").pageSize;  
				},  
				"pageIndex" : function(){  
					return $('#djjlRecordId').datagrid("getPager").pagination("options").pageNumber;  
				}

			},
			pageSize:10,
			view: detailview,
			detailFormatter:function(index,rowData){
				if(rowData.bz==null){
					rowData.bz=" ";
				}
				return '<table><tr><td>备注:'+rowData.bz+'</td></tr></table>'
			},
	});
};

/*
 * 五项体检
 */
var wxtjTable = function(){
	$('#wxtjRecordId').datagrid({
		width: '100%',
		height: '100%',
		fitColumns: true,
		singleSelect:true,
		url:'',
		method:'post',
		//对应json数据中的每一列
		columns : [ [
			{field : '', width : 50,checkbox:'true',},
			{field : 'xcg',width : 150,title:'血常规',sortable:'true',formatter: function(value,row,index){return '<span title='+(row.xcg==null?"":row.xcg)+'>'+(row.xcg==null?"":row.xcg)+'</span>'}},
			{field : 'xdt',title : '心电图',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.xdt==null?"":row.xdt)+'>'+(row.xdt==null?"":row.xdt)+'</span>'}}, 
			{field : 'BC',title : 'B超',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.BC==null?"":row.BC)+'>'+(row.BC==null?"":row.BC)+'</span>'}},
			{field : 'zq',title : '脏器',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.zq==null?"":row.v)+'>'+(row.zq==null?"":row.zq)+'</span>'}},
			{field : 'xp',title : '胸片',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.xp==null?"":row.xp)+'>'+(row.xp==null?"":row.xp)+'</span>'}},
			{field : 'jcr',title : '检查人',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.jcr==null?"":row.jcr)+'>'+(row.jcr==null?"":row.jcr)+'</span>'}},
			{field : 'jcsj',title : '检查时间',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.jcsj==null?"":row.jcsj)+'>'+(row.jcsj==null?"":row.jcsj)+'</span>'}},
			{field : 'jclx',title : '检查类型',width : 150,sortable:'true',formatter: function(value,row,index){return '<span title='+(row.jclx==null?"":row.jclx)+'>'+(row.jclx==null?"":row.jclx)+'</span>'}},
			] ],
			idField:'id',
			loadMsg:'加载中, 请  稍  等  …',
//			pagination:true,
			sortName:'blrqString',
			sortOrder:'desc',
			onDblClickRow: function(){
				saveHjbl();
			},
			onLoadSuccess: function(data){//加载完毕后获取所有的checkbox遍历
				$('#wxtjRecordId').datagrid("selectRow", 0);
			},
			queryParams:{  
				"pageSize" : function(){  
					return $('#wxtjRecordId').datagrid("getPager").pagination("options").pageSize;  
				},  
				"pageIndex" : function(){  
					return $('#wxtjRecordId').datagrid("getPager").pagination("options").pageNumber;  
				}

			},
			pageSize:10,
			view: detailview,
			detailFormatter:function(index,rowData){
				if(rowData.bz==null){
					rowData.bz=" ";
				}
				return '<table><tr><td>备注:'+rowData.bz+'</td></tr></table>'
			},
	});
};

/*
 * 体表伤情 显示隐藏
 * 
 */
function tbsq(){
$("#tbsqID").bind("click",function(event){
	event.stopPropagation(); // 阻止向上冒泡
	if($("#Menu_tbsq").is(":hidden")){
		//获取checked值并且默认选中=true显示div
		var yy = document.getElementById('tbsq').checked;
		document.getElementById('tbsq').checked=true;
		$("#Menu_tbsq").show();
		
	}else{
		//checked值选中=false并且隐藏div
		$("[name = tbsqID]:checkbox").attr("checked", false);
		$("#Menu_tbsq").hide();
	}
});
$(function(){
	$("#Menu_tbsq").hide(); // 页面加载时隐藏该元素
});
}
/*
 * 体貌特征一
 */
function tmtzOne(){
	$("#tmtzOneID").bind("click",function(event){
		event.stopPropagation(); // 阻止向上冒泡
		if($("#Menu_tmtzOne").is(":hidden")){
			//获取checked值并且默认选中=true显示div
			var yy = document.getElementById('tmtz1').checked;
			document.getElementById('tmtz1').checked=true;
			$("#Menu_tmtzOne").show();
			
		}else{
			//checked值选中=false并且隐藏div
			$("[name = tmtzOneID]:checkbox").attr("checked", false);
			$("#Menu_tmtzOne").hide();
		}
	});
	$(function(){
		$("#Menu_tmtzOne").hide(); // 页面加载时隐藏该元素
	});
}
/*
 * 体貌特征二
 */
function tmtzTwo(){
	$("#tmtzTwoID").bind("click",function(event){
		event.stopPropagation(); // 阻止向上冒泡
		if($("#Menu_tmtzTwo").is(":hidden")){
			//获取checked值并且默认选中=true显示div
			var yy = document.getElementById('tmtz2').checked;
			document.getElementById('tmtz2').checked=true;
			$("#Menu_tmtzTwo").show();
			
		}else{
			//checked值选中=false并且隐藏div
			$("[name = tmtzTwoID]:checkbox").attr("checked", false);
			$("#Menu_tmtzTwo").hide();
		}
	});
	$(function(){
		$("#Menu_tmtzTwo").hide(); // 页面加载时隐藏该元素
	});
}
/*
 * 体貌特征三
 */
function tmtzThree(){
	$("#tmtzThreeID").bind("click",function(event){
		event.stopPropagation(); // 阻止向上冒泡
		if($("#Menu_tmtzThree").is(":hidden")){
			//获取checked值并且默认选中=true显示div
			var yy = document.getElementById('tmtz3').checked;
			document.getElementById('tmtz3').checked=true;
			$("#Menu_tmtzThree").show();
			
		}else{
			//checked值选中=false并且隐藏div
			$("[name = tmtzThreeID]:checkbox").attr("checked", false);
			$("#Menu_tmtzThree").hide();
		}
	});
	$(function(){
		$("#Menu_tmtzThree").hide(); // 页面加载时隐藏该元素
	});
}
/*
 * 体貌特征四
 */
function tmtzFour(){
	$("#tmtzFourID").bind("click",function(event){
		event.stopPropagation(); // 阻止向上冒泡
		if($("#Menu_tmtzFour").is(":hidden")){
			//获取checked值并且默认选中=true显示div
			var yy = document.getElementById('tmtz4').checked;
			document.getElementById('tmtz4').checked=true;
			$("#Menu_tmtzFour").show();
			
		}else{
			//checked值选中=false并且隐藏div
			$("[name = tmtzFourID]:checkbox").attr("checked", false);
			$("#Menu_tmtzFour").hide();
		}
	});
	$(function(){
		$("#Menu_tmtzFour").hide(); // 页面加载时隐藏该元素
	});
}
/*
 * 体貌特征五
 */
function tmtzFive(){
	$("#tmtzFiveID").bind("click",function(event){
		event.stopPropagation(); // 阻止向上冒泡
		if($("#Menu_tmtzFive").is(":hidden")){
			//获取checked值并且默认选中=true显示div
			var yy = document.getElementById('tmtz5').checked;
			document.getElementById('tmtz5').checked=true;
			$("#Menu_tmtzFive").show();
			
		}else{
			//checked值选中=false并且隐藏div
			$("[name = tmtzFiveID]:checkbox").attr("checked", false);
			$("#Menu_tmtzFive").hide();
		}
	});
	$(function(){
		$("#Menu_tmtzFive").hide(); // 页面加载时隐藏该元素
	});
}
$(document).ready(function(){
	
	tbsq();
	tmtzOne()
	tmtzTwo();
	tmtzThree();
	tmtzFour();
	tmtzFive();
	
	aybdTable();
	lishjTable();
	xqbdTable();
	yqxxTable();
	pjdjTables();
	tsdjTable();
	lvshjTable();
	tafTable();
	jyxxTable();
	jjfjlTable();
	djjlTable();
	wxtjTable();
});
